import os.path
from configs.settings import *
from utils.ai_translator.model.glm_model import *
from utils.ai_translator.translator.pdf_translator import *

model_name = MODEL_SETTINGS.get("model")
api_key = MODEL_SETTINGS.get("api_key")


def test_case():
    dir_name = os.path.dirname(__file__)
    pdf_file_path = os.path.join(os.path.dirname(dir_name), "files", "test.pdf")
    model_obj = GLMModel(api_key, model_name)
    pdf_translator_obj = PDFTranslator(model_obj, pdf_file_path)
    pdf_translator_obj.translate_pdf(pdf_file_path)


def test_case2():
    dir_name = os.path.dirname(__file__)
    pdf_file_path = os.path.join(os.path.dirname(dir_name), "files", "test.pdf")
    model_obj = GLMModel(api_key, model_name)
    pdf_translator_obj = PDFTranslator(model_obj, pdf_file_path)
    print(pdf_translator_obj.get_book_language())


if __name__ == '__main__':
    test_case2()
